<%@page import="com.eos.orm.mybatis.model.SysCustomerLink"%>
<%@page import="com.eos.common.tool.DataCacheUtil"%>
<%@page import="com.eos.orm.mybatis.model.SysUser"%>
<%@page import="com.eos.orm.mybatis.model.SysCustomer"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html; charset=utf-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<% 
List<SysCustomerLink> customerLinkList = (List<SysCustomerLink>)request.getAttribute("customerLinkList");
%>
<style>
.page .searchBar label{width:80px;}
</style>
<!-- 此处加action="employeeCtrl.ctrl"是为了条件查询时仍能显示排序图标 -->
<form id="pagerForm" method="post" action="customerLinkList">
	<input type="hidden" name="pageNum" value="${pageNum}" />
	<input type="hidden" name="numPerPage" value="${numPerPage}" />
</form>
<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" rel="pagerForm" method="post" action="customerLinkList">
		<div class="searchBar">
			<input type="hidden" name="numPerPage" value="${numPerPage}" />
			<input type="hidden" name="pageNum" value="${pageNum}" /> 
			<table class="searchContent">
				<tr>
					<td>
						<label>客户ID：</label>
						<input type="text" style="float:left;" size="16" class="txtinput" name="customerId" value="${customerId}" />
						<a title="查找带回" lookuppk="customerId" width="900" height="450" maxable="false" lookupgroup="" href="lookUpCustomerList" class="btnLook">查找带回</a>
					</td>
					<td>
						<label>联系人姓名：</label>
						<input type="text" size="18" class="txtinput" name="linkName" value="${linkName }" />
					</td>
					<td>
						<div class="subBar">
							<ul>
								<li>
									<div class="buttonActive">
										<div class="buttonContent">
											<button type="submit">
												检索
											</button>
										</div>
									</div>
								</li>
							</ul>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li>
				<a class="edit" style="font-weight: bold;color:#6495ED;" href="editCustomerLink?linkId={sid_linkId}&navTabId=editCustomerLink"
					 target="dialog" mask="true" maxable="false" width="610" height="340" rel="editCustomerLink" title="编辑客户联系人信息"><span>编辑联系人</span>
				</a>
			</li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="115">
		<thead>
			<tr>
				<th width="80">序号</th>
				<th>联系方式ID</th>
				<th>客户名称</th>
				<th>姓名</th>
				<th>职务</th>
				<th>电话</th>
				<th>手机</th>
				<th>传真</th>
				<th>QQ</th>
				<th>微信号</th>
				<th>负责事宜</th>
			</tr>
		</thead>
		<tbody>
			<% 
				if(null != customerLinkList){
					int i = 1;
					for(SysCustomerLink sl : customerLinkList){
			%> 
				<tr target="sid_linkId" rel="<%=sl.getId() %>">
					<td>
						<%=i++ %>
					</td>
					<td><%=sl.getId() %></td>
					<td>
					<%
						SysCustomer cs = DataCacheUtil.getSysCustomer(sl.getCustomerId());
						if(null != cs)
							out.print(cs.getCustomerName());
					%>
					</td>
					<td><%=sl.getLinkName() %></td>
					<td><%=sl.getLinkJob() %></td>
					<td><%=sl.getLinkMobile() %></td>
					<td><%=sl.getLinkTelephone() %></td>
					<td>
						<%=sl.getLinkFax() %>
					</td>
					<td>
					<%=sl.getLinkQq() %>
					</td>
					<td><%=sl.getLinkWx() %></td>
					<td>
						<%=sl.getJobDuty() %>
					</td>
				</tr>
			<%}
			} %>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<!-- pageNum:1是当更改numPerPage时，使pageNum=1重新开始，否则可能无数据 -->
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value, pageNum:1})">
				<option value="15" ${numPerPage==15?'selected':''}>
					15
				</option>
				<option value="20" ${numPerPage==20?'selected':''}>
					20
				</option>
				<option value="25" ${numPerPage==25?'selected':''}>
					25
				</option>
				<option value="50" ${numPerPage==50?'selected':''}>
					50
				</option>
				<option value="100" ${numPerPage==100?'selected':''}>
					100
				</option>
			</select>
			<span>条，共${totalCount }条 </span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="${totalCount }" numPerPage="${numPerPage}" pageNumShown="5" currentPage="${pageNum }"></div>
	</div>
</div>
